package com.choichumgming.rentcat.web.rpc;

import com.choichumgming.rentcat.common.api.CommonResult;
import com.choichumgming.rentcat.model.UmsMemberReceiveAddress;
import com.choichumgming.rentcat.service.UmsMemberReceiveAddressFeignApi;
import com.choichumgming.rentcat.service.UmsMemberReceiveAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "UmsMemberReceiveAddressController", description = "会员收货地址管理")
@RequestMapping("api/address")
public class UmsMemberReceiveAddressFeignClient implements UmsMemberReceiveAddressFeignApi {
    @Autowired
    private UmsMemberReceiveAddressService memberReceiveAddressService;

    @Override
    @ApiOperation("显示收货地址")
    @RequestMapping(value = "/item")
    @ResponseBody
    public CommonResult<UmsMemberReceiveAddress> getItem(@RequestParam(value="addressId", defaultValue="1") Long addressId) {
        UmsMemberReceiveAddress address = memberReceiveAddressService.getItem(addressId);
        return CommonResult.success(address);
    }

}
